本文整理汇总了C++中restoreGeometry函数的典型用法代码示例。如果您正苦于以下问题:C++ restoreGeometry函数的具体用法?C++ restoreGeometry怎么用?C++ restoreGeometry使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了restoreGeometry函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ParentWindow
MainWindow::MainWindow(bool useSocket, QWidget *parent) :
ParentWindow(parent),
m_page(0),
m_webView(new QGraphicsWebView),
#ifndef MEEGO_EDITION_HARMATTAN
m_actionMinimizeToTray(new QAction(i18n("&Minimize to Tray"), this)),
#endif
m_inspector(0),
m_useSocket(useSocket)
{
#ifdef Q_OS_UNIX
chdir(PREFIX);
#endif
setWindowTitle(i18n("Hotot"));
setWindowIcon(QIcon::fromTheme("hotot_qt", QIcon("share/hotot-qt/html/image/ic64_hotot.png")));
qApp->setWindowIcon(QIcon::fromTheme("hotot_qt", QIcon("share/hotot-qt/html/image/ic64_hotot.png")));
m_webView->setPreferredSize(QSize(640, 480));
#ifndef MEEGO_EDITION_HARMATTAN
HototWebView* view = new HototWebView(m_webView, this);
this->resize(QSize(640, 480));
this->setCentralWidget(view);
#else
MApplicationPage* page = new MApplicationPage;
page->setCentralWidget(m_webView);
page->setComponentsDisplayMode(MApplicationPage::AllComponents,
MApplicationPageModel::Hide);
page->setAutoMarginsForComponentsEnabled(false);
page->resize(page->exposedContentRect().size());
page->appear(this, MSceneWindow::DestroyWhenDone);
page->setPannable(false);
#endif
#ifndef MEEGO_EDITION_HARMATTAN
QSettings settings("hotot-qt", "hotot");
restoreGeometry(settings.value("geometry").toByteArray());
restoreState(settings.value("windowState").toByteArray());
#endif
m_menu = new QMenu(this);
#ifndef MEEGO_EDITION_HARMATTAN
m_actionMinimizeToTray->setCheckable(true);
m_actionMinimizeToTray->setChecked(settings.value("minimizeToTray", true).toBool());
connect(m_actionMinimizeToTray, SIGNAL(toggled(bool)), this, SLOT(toggleMinimizeToTray(bool)));
m_menu->addAction(m_actionMinimizeToTray);
#endif
m_actionExit = new QAction(QIcon::fromTheme("application-exit"), i18n("&Exit"), this);
m_actionExit->setShortcut(QKeySequence::Quit);
connect(m_actionExit, SIGNAL(triggered()), this, SLOT(exit()));
m_menu->addAction(m_actionExit);
m_actionDev = new QAction(QIcon::fromTheme("configure"), i18n("&Developer Tool"), this);
connect(m_actionDev, SIGNAL(triggered()), this, SLOT(showDeveloperTool()));
#ifdef HAVE_KDE
m_tray = new KDETrayBackend(this);
#else
m_tray = new QtTrayBackend(this);
#endif
m_tray->setContextMenu(m_menu);
#ifndef MEEGO_EDITION_HARMATTAN
addAction(m_actionExit);
#endif
m_page = new HototWebPage(this);
QWebSettings::setOfflineStoragePath(QDir::homePath().append("/.config/hotot-qt"));
QWebSettings::setOfflineStorageDefaultQuota(15 * 1024 * 1024);
m_webView->setPage(m_page);
m_webView->settings()->globalSettings()->setAttribute(QWebSettings::LocalContentCanAccessFileUrls, true);
m_webView->settings()->globalSettings()->setAttribute(QWebSettings::LocalContentCanAccessRemoteUrls, true);
m_webView->settings()->globalSettings()->setAttribute(QWebSettings::LocalStorageEnabled, true);
m_webView->settings()->globalSettings()->setAttribute(QWebSettings::OfflineStorageDatabaseEnabled, true);
m_webView->settings()->globalSettings()->setAttribute(QWebSettings::JavascriptCanOpenWindows, true);
m_webView->settings()->globalSettings()->setAttribute(QWebSettings::JavascriptCanAccessClipboard, true);
m_webView->settings()->globalSettings()->setAttribute(QWebSettings::JavascriptEnabled, true);
m_inspector = new QWebInspector;
m_inspector->setPage(m_page);
#ifdef MEEGO_EDITION_HARMATTAN
connect(page, SIGNAL(exposedContentRectChanged()), this, SLOT(contentSizeChanged()));
m_page->setPreferredContentsSize(page->exposedContentRect().size().toSize());
m_webView->setResizesToContents(true);
#endif
#ifdef Q_OS_UNIX
m_webView->load(QUrl("file://" PREFIX "/share/hotot-qt/html/index.html"));
#else
QFileInfo f("share/hotot-qt/html/index.html");
m_webView->load(QUrl::fromLocalFile(f.absoluteFilePath()));
#endif
connect(m_webView, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool)));
}
开发者ID:atilacamurca,项目名称:Hotot,代码行数:98,代码来源:mainwindow.cpp
示例2: QDialog
QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWidget *parent, Qt::WindowFlags flags )
: QDialog( parent, flags )
, mDock( nullptr )
, mLayer( theLayer )
, mRubberBand( nullptr )
, mCurrentSearchWidgetWrapper( nullptr )
{
setupUi( this );
Q_FOREACH ( const QgsField& field, mLayer->fields() )
{
mVisibleFields.append( field.name() );
}
// Fix selection color on loosing focus (Windows)
setStyleSheet( QgisApp::instance()->styleSheet() );
setAttribute( Qt::WA_DeleteOnClose );
layout()->setMargin( 0 );
layout()->setContentsMargins( 0, 0, 0, 0 );
static_cast< QGridLayout* >( layout() )->setVerticalSpacing( 0 );
QSettings settings;
int size = settings.value( QStringLiteral( "/IconSize" ), 16 ).toInt();
if ( size > 32 )
{
size -= 16;
}
else if ( size == 32 )
{
size = 24;
}
else
{
size = 16;
}
mToolbar->setIconSize( QSize( size, size ) );
// Initialize the window geometry
restoreGeometry( settings.value( QStringLiteral( "/Windows/BetterAttributeTable/geometry" ) ).toByteArray() );
myDa = new QgsDistanceArea();
myDa->setSourceCrs( mLayer->crs() );
myDa->setEllipsoidalMode( QgisApp::instance()->mapCanvas()->mapSettings().hasCrsTransformEnabled() );
myDa->setEllipsoid( QgsProject::instance()->ellipsoid() );
mEditorContext.setDistanceArea( *myDa );
mEditorContext.setVectorLayerTools( QgisApp::instance()->vectorLayerTools() );
QgsFeatureRequest r;
if ( mLayer->geometryType() != QgsWkbTypes::NullGeometry &&
settings.value( QStringLiteral( "/qgis/attributeTableBehaviour" ), QgsAttributeTableFilterModel::ShowAll ).toInt() == QgsAttributeTableFilterModel::ShowVisible )
{
QgsMapCanvas *mc = QgisApp::instance()->mapCanvas();
QgsRectangle extent( mc->mapSettings().mapToLayerCoordinates( theLayer, mc->extent() ) );
r.setFilterRect( extent );
mRubberBand = new QgsRubberBand( mc, QgsWkbTypes::PolygonGeometry );
mRubberBand->setToGeometry( QgsGeometry::fromRect( extent ), theLayer );
mActionShowAllFilter->setText( tr( "Show All Features In Initial Canvas Extent" ) );
}
// Initialize dual view
mMainView->init( mLayer, QgisApp::instance()->mapCanvas(), r, mEditorContext );
QgsAttributeTableConfig config = mLayer->attributeTableConfig();
mMainView->setAttributeTableConfig( config );
// Initialize filter gui elements
mFilterActionMapper = new QSignalMapper( this );
mFilterColumnsMenu = new QMenu( this );
mActionFilterColumnsMenu->setMenu( mFilterColumnsMenu );
mApplyFilterButton->setDefaultAction( mActionApplyFilter );
// Set filter icon in a couple of places
QIcon filterIcon = QgsApplication::getThemeIcon( "/mActionFilter2.svg" );
mActionShowAllFilter->setIcon( filterIcon );
mActionAdvancedFilter->setIcon( filterIcon );
mActionSelectedFilter->setIcon( filterIcon );
mActionVisibleFilter->setIcon( filterIcon );
mActionEditedFilter->setIcon( filterIcon );
// Connect filter signals
connect( mActionAdvancedFilter, SIGNAL( triggered() ), SLOT( filterExpressionBuilder() ) );
connect( mActionShowAllFilter, SIGNAL( triggered() ), SLOT( filterShowAll() ) );
connect( mActionSelectedFilter, SIGNAL( triggered() ), SLOT( filterSelected() ) );
connect( mActionVisibleFilter, SIGNAL( triggered() ), SLOT( filterVisible() ) );
connect( mActionEditedFilter, SIGNAL( triggered() ), SLOT( filterEdited() ) );
connect( mFilterActionMapper, SIGNAL( mapped( QObject* ) ), SLOT( filterColumnChanged( QObject* ) ) );
connect( mFilterQuery, SIGNAL( returnPressed() ), SLOT( filterQueryAccepted() ) );
connect( mActionApplyFilter, SIGNAL( triggered() ), SLOT( filterQueryAccepted() ) );
connect( mActionSetStyles, SIGNAL( triggered() ), SLOT( openConditionalStyles() ) );
// info from layer to table
connect( mLayer, SIGNAL( editingStarted() ), this, SLOT( editingToggled() ) );
connect( mLayer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) );
//.........这里部分代码省略.........
开发者ID:liminlu0314,项目名称:QGIS,代码行数:101,代码来源:qgsattributetabledialog.cpp
示例3: restoreGeometry
/*!
* Function to restore dialog window state
*/
void QgsConfigureShortcutsDialog::restoreState()
{
QSettings settings;
restoreGeometry( settings.value( "/Windows/ShortcutsDialog/geometry" ).toByteArray() );
}
开发者ID:stevenmizuno,项目名称:QGIS,代码行数:8,代码来源:qgsconfigureshortcutsdialog.cpp
示例4: QMainWindow
//.........这里部分代码省略.........
setupFilterToolbar();
setupAddressToolbar();
const QString windowTitle = helpEngineWrapper.windowTitle();
setWindowTitle(windowTitle.isEmpty() ? defWindowTitle : windowTitle);
QByteArray iconArray = helpEngineWrapper.applicationIcon();
if (iconArray.size() > 0) {
QPixmap pix;
pix.loadFromData(iconArray);
QIcon appIcon(pix);
qApp->setWindowIcon(appIcon);
} else {
QIcon appIcon(QLatin1String(":/trolltech/assistant/images/assistant-128.png"));
qApp->setWindowIcon(appIcon);
}
QToolBar *toolBar = addToolBar(tr("Bookmark Toolbar"));
toolBar->setObjectName(QLatin1String("Bookmark Toolbar"));
bookMarkManager->setBookmarksToolbar(toolBar);
// Show the widget here, otherwise the restore geometry and state won't work
// on x11.
show();
toolBar->hide();
toolBarMenu()->addAction(toolBar->toggleViewAction());
QByteArray ba(helpEngineWrapper.mainWindow());
if (!ba.isEmpty())
restoreState(ba);
ba = helpEngineWrapper.mainWindowGeometry();
if (!ba.isEmpty()) {
restoreGeometry(ba);
} else {
tabifyDockWidget(contentDock, indexDock);
tabifyDockWidget(indexDock, bookmarkDock);
tabifyDockWidget(bookmarkDock, searchDock);
contentDock->raise();
const QRect screen = QApplication::desktop()->screenGeometry();
resize(4*screen.width()/5, 4*screen.height()/5);
}
if (!helpEngineWrapper.hasFontSettings()) {
helpEngineWrapper.setUseAppFont(false);
helpEngineWrapper.setUseBrowserFont(false);
helpEngineWrapper.setAppFont(qApp->font());
helpEngineWrapper.setAppWritingSystem(QFontDatabase::Latin);
helpEngineWrapper.setBrowserFont(qApp->font());
helpEngineWrapper.setBrowserWritingSystem(QFontDatabase::Latin);
} else {
updateApplicationFont();
}
updateAboutMenuText();
QTimer::singleShot(0, this, SLOT(insertLastPages()));
if (m_cmdLine->enableRemoteControl())
(void)new RemoteControl(this);
if (m_cmdLine->contents() == CmdLineParser::Show)
showContents();
else if (m_cmdLine->contents() == CmdLineParser::Hide)
hideContents();
if (m_cmdLine->index() == CmdLineParser::Show)
开发者ID:Suneal,项目名称:qt,代码行数:67,代码来源:mainwindow.cpp
示例5: QDialog
QgsFieldCalculator::QgsFieldCalculator( QgsVectorLayer* vl )
: QDialog()
, mVectorLayer( vl )
, mAttributeId( -1 )
{
setupUi( this );
if ( !vl )
return;
builder->setLayer( vl );
builder->loadFieldNames();
populateFields();
populateOutputFieldTypes();
connect( builder, SIGNAL( expressionParsed( bool ) ), this, SLOT( setOkButtonState() ) );
QgsDistanceArea myDa;
myDa.setSourceCrs( vl->crs().srsid() );
myDa.setEllipsoidalMode( QgisApp::instance()->mapCanvas()->mapSettings().hasCrsTransformEnabled() );
myDa.setEllipsoid( QgsProject::instance()->readEntry( "Measure", "/Ellipsoid", GEO_NONE ) );
builder->setGeomCalculator( myDa );
//default values for field width and precision
mOutputFieldWidthSpinBox->setValue( 10 );
mOutputFieldPrecisionSpinBox->setValue( 3 );
if ( vl->providerType() == "ogr" && vl->storageType() == "ESRI Shapefile" )
{
mOutputFieldNameLineEdit->setMaxLength( 10 );
}
mUpdateExistingGroupBox->setEnabled( vl->dataProvider()->capabilities() & QgsVectorDataProvider::ChangeAttributeValues );
mNewFieldGroupBox->setEnabled( vl->dataProvider()->capabilities() & QgsVectorDataProvider::AddAttributes );
Q_ASSERT( mNewFieldGroupBox->isEnabled() || mUpdateExistingGroupBox->isEnabled() );
if ( mNewFieldGroupBox->isEnabled() )
{
mNewFieldGroupBox->setChecked( true );
}
else
{
mNewFieldGroupBox->setToolTip( tr( "Not available for layer" ) );
mUpdateExistingGroupBox->setChecked( true );
mUpdateExistingGroupBox->setCheckable( false );
}
if ( mUpdateExistingGroupBox->isEnabled() )
{
mUpdateExistingGroupBox->setChecked( !mNewFieldGroupBox->isEnabled() );
}
else
{
mUpdateExistingGroupBox->setToolTip( tr( "Not available for layer" ) );
mNewFieldGroupBox->setChecked( true );
mNewFieldGroupBox->setCheckable( false );
}
bool hasselection = vl->selectedFeaturesIds().size() > 0;
mOnlyUpdateSelectedCheckBox->setChecked( hasselection );
mOnlyUpdateSelectedCheckBox->setEnabled( hasselection );
mOnlyUpdateSelectedCheckBox->setText( tr( "Only update %1 selected features" ).arg( vl->selectedFeaturesIds().size() ) );
builder->loadRecent( "fieldcalc" );
QSettings settings;
restoreGeometry( settings.value( "/Windows/QgsFieldCalculator/geometry" ).toByteArray() );
}
开发者ID:Aladar64,项目名称:QGIS,代码行数:70,代码来源:qgsfieldcalculator.cpp
示例6: QMainWindow
BitcoinGUI::BitcoinGUI(const PlatformStyle *_platformStyle, const NetworkStyle *networkStyle, QWidget *parent) :
QMainWindow(parent),
enableWallet(false),
clientModel(0),
walletFrame(0),
unitDisplayControl(0),
labelWalletEncryptionIcon(0),
labelWalletHDStatusIcon(0),
connectionsControl(0),
labelBlocksIcon(0),
progressBarLabel(0),
progressBar(0),
progressDialog(0),
appMenuBar(0),
appToolBar(0),
overviewAction(0),
historyAction(0),
quitAction(0),
sendCoinsAction(0),
sendCoinsMenuAction(0),
usedSendingAddressesAction(0),
usedReceivingAddressesAction(0),
signMessageAction(0),
verifyMessageAction(0),
aboutAction(0),
receiveCoinsAction(0),
receiveCoinsMenuAction(0),
optionsAction(0),
toggleHideAction(0),
encryptWalletAction(0),
backupWalletAction(0),
changePassphraseAction(0),
aboutQtAction(0),
openRPCConsoleAction(0),
openAction(0),
showHelpMessageAction(0),
trayIcon(0),
trayIconMenu(0),
notificator(0),
rpcConsole(0),
helpMessageDialog(0),
modalOverlay(0),
prevBlocks(0),
spinnerFrame(0),
platformStyle(_platformStyle)
{
QSettings settings;
if (!restoreGeometry(settings.value("MainWindowGeometry").toByteArray())) {
// Restore failed (perhaps missing setting), center the window
move(QApplication::desktop()->availableGeometry().center() - frameGeometry().center());
}
QString windowTitle = tr(PACKAGE_NAME) + " - ";
#ifdef ENABLE_WALLET
enableWallet = WalletModel::isWalletEnabled();
#endif // ENABLE_WALLET
if(enableWallet)
{
windowTitle += tr("Wallet");
} else {
windowTitle += tr("Node");
}
windowTitle += " " + networkStyle->getTitleAddText();
#ifndef Q_OS_MAC
QApplication::setWindowIcon(networkStyle->getTrayAndWindowIcon());
setWindowIcon(networkStyle->getTrayAndWindowIcon());
#else
MacDockIconHandler::instance()->setIcon(networkStyle->getAppIcon());
#endif
setWindowTitle(windowTitle);
#if defined(Q_OS_MAC) && QT_VERSION < 0x050000
// This property is not implemented in Qt 5. Setting it has no effect.
// A replacement API (QtMacUnifiedToolBar) is available in QtMacExtras.
setUnifiedTitleAndToolBarOnMac(true);
#endif
rpcConsole = new RPCConsole(_platformStyle, 0);
helpMessageDialog = new HelpMessageDialog(this, false);
#ifdef ENABLE_WALLET
if(enableWallet)
{
/** Create wallet frame and make it the central widget */
walletFrame = new WalletFrame(_platformStyle, this);
setCentralWidget(walletFrame);
} else
#endif // ENABLE_WALLET
{
/* When compiled without wallet or -disablewallet is provided,
* the central widget is the rpc console.
*/
setCentralWidget(rpcConsole);
}
// Accept D&D of URIs
setAcceptDrops(true);
// Create actions for the toolbar, menu bar and tray/dock icon
// Needs walletFrame to be initialized
createActions();
//.........这里部分代码省略.........
开发者ID:OrangeMan110,项目名称:bitcoin,代码行数:101,代码来源:bitcoingui.cpp
示例7: QDialog
AddFixture::AddFixture(QWidget* parent, const Doc* doc, const Fixture* fxi)
: QDialog(parent)
, m_doc(doc)
{
m_addressValue = 0;
m_universeValue = 0;
m_amountValue = 1;
m_gapValue = 0;
m_channelsValue = 1;
m_fixtureDef = NULL;
m_mode = NULL;
m_fxiCount = 0;
m_fixtureID = Fixture::invalidId();
m_invalidAddressFlag = false;
setupUi(this);
m_addrErrorLabel->hide();
QAction* action = new QAction(this);
action->setShortcut(QKeySequence(QKeySequence::Close));
connect(action, SIGNAL(triggered(bool)), this, SLOT(reject()));
addAction(action);
connect(m_tree, SIGNAL(itemSelectionChanged()),
this, SLOT(slotSelectionChanged()));
connect(m_tree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)),
this, SLOT(slotTreeDoubleClicked(QTreeWidgetItem*)));
connect(m_modeCombo, SIGNAL(activated(const QString&)),
this, SLOT(slotModeActivated(const QString&)));
connect(m_universeCombo, SIGNAL(activated(int)),
this, SLOT(slotUniverseActivated(int)));
connect(m_addressSpin, SIGNAL(valueChanged(int)),
this, SLOT(slotAddressChanged(int)));
connect(m_channelsSpin, SIGNAL(valueChanged(int)),
this, SLOT(slotChannelsChanged(int)));
connect(m_nameEdit, SIGNAL(textEdited(const QString&)),
this, SLOT(slotNameEdited(const QString&)));
connect(m_gapSpin, SIGNAL(valueChanged(int)),
this, SLOT(slotGapSpinChanged(int)));
connect(m_amountSpin, SIGNAL(valueChanged(int)),
this, SLOT(slotAmountSpinChanged(int)));
connect(m_searchEdit, SIGNAL(textChanged(QString)),
this, SLOT(slotSearchFilterChanged(QString)));
connect(m_diptoolButton, SIGNAL(clicked()),
this, SLOT(slotDiptoolButtonClicked()));
/* Fill fixture definition tree (and select a fixture def) */
if (fxi != NULL)
{
fillTree(fxi->fixtureDef()->manufacturer(), fxi->fixtureDef()->model());
m_fixtureID = fxi->id();
}
else
fillTree(KXMLFixtureGeneric, KXMLFixtureGeneric);
m_fixturesCount->setText(tr("Fixtures found: %1").arg(m_fxiCount));
/* Fill universe combo with available universes */
m_universeCombo->addItems(m_doc->inputOutputMap()->universeNames());
/* Simulate first selection and find the next free address */
slotSelectionChanged();
if (fxi != NULL)
{
// Universe
m_universeCombo->setCurrentIndex(fxi->universe());
slotUniverseActivated(fxi->universe());
m_addressSpin->setValue(fxi->address() + 1);
m_addressValue = fxi->address();
m_multipleGroup->setEnabled(false);
// Name
m_nameEdit->setText(fxi->name());
slotNameEdited(fxi->name());
m_nameEdit->setModified(true); // Prevent auto-naming
// Mode
int index = m_modeCombo->findText(fxi->fixtureMode()->name());
if (index != -1)
{
m_channelsSpin->setValue(fxi->channels());
m_modeCombo->setCurrentIndex(index);
slotModeActivated(m_modeCombo->itemText(index));
}
}
else
{
slotUniverseActivated(0);
findAddress();
m_channelsSpin->setValue(1);
}
QSettings settings;
QVariant var = settings.value(SETTINGS_GEOMETRY);
if (var.isValid() == true)
restoreGeometry(var.toByteArray());
//.........这里部分代码省略.........
开发者ID:joepadmiraal,项目名称:qlcplus,代码行数:101,代码来源:addfixture.cpp
示例8: QDialog
QgsNewVectorLayerDialog::QgsNewVectorLayerDialog( QWidget *parent, const Qt::WindowFlags& fl )
: QDialog( parent, fl )
{
setupUi( this );
QSettings settings;
restoreGeometry( settings.value( "/Windows/NewVectorLayer/geometry" ).toByteArray() );
mAddAttributeButton->setIcon( QgsApplication::getThemeIcon( "/mActionNewAttribute.svg" ) );
mRemoveAttributeButton->setIcon( QgsApplication::getThemeIcon( "/mActionDeleteAttribute.svg" ) );
mTypeBox->addItem( tr( "Text data" ), "String" );
mTypeBox->addItem( tr( "Whole number" ), "Integer" );
mTypeBox->addItem( tr( "Decimal number" ), "Real" );
mTypeBox->addItem( tr( "Date" ), "Date" );
mWidth->setValidator( new QIntValidator( 1, 255, this ) );
mPrecision->setValidator( new QIntValidator( 0, 15, this ) );
mPointRadioButton->setChecked( true );
mFileFormatComboBox->addItem( tr( "ESRI Shapefile" ), "ESRI Shapefile" );
#if 0
// Disabled until provider properly supports editing the created file formats
// When enabling this, adapt the window-title of the dialog and the title of all actions showing this dialog.
mFileFormatComboBox->addItem( tr( "Comma Separated Value" ), "Comma Separated Value" );
mFileFormatComboBox->addItem( tr( "GML" ), "GML" );
mFileFormatComboBox->addItem( tr( "Mapinfo File" ), "Mapinfo File" );
#endif
if ( mFileFormatComboBox->count() == 1 )
{
mFileFormatComboBox->setVisible( false );
mFileFormatLabel->setVisible( false );
}
mFileFormatComboBox->setCurrentIndex( 0 );
mFileEncoding->addItems( QgsVectorDataProvider::availableEncodings() );
// Use default encoding if none supplied
QString enc = QSettings().value( "/UI/encoding", "System" ).toString();
// The specified decoding is added if not existing alread, and then set current.
// This should select it.
int encindex = mFileEncoding->findText( enc );
if ( encindex < 0 )
{
mFileEncoding->insertItem( 0, enc );
encindex = 0;
}
mFileEncoding->setCurrentIndex( encindex );
mOkButton = buttonBox->button( QDialogButtonBox::Ok );
mAttributeView->addTopLevelItem( new QTreeWidgetItem( QStringList() << "id" << "Integer" << "10" << "" ) );
QgsCoordinateReferenceSystem defaultCrs = QgsCRSCache::instance()->crsByOgcWmsCrs( settings.value( "/Projections/layerDefaultCrs", GEO_EPSG_CRS_AUTHID ).toString() );
defaultCrs.validate();
mCrsSelector->setCrs( defaultCrs );
connect( mNameEdit, SIGNAL( textChanged( QString ) ), this, SLOT( nameChanged( QString ) ) );
connect( mAttributeView, SIGNAL( itemSelectionChanged() ), this, SLOT( selectionChanged() ) );
mAddAttributeButton->setEnabled( false );
mRemoveAttributeButton->setEnabled( false );
}
开发者ID:GavrisAS,项目名称:QGIS,代码行数:64,代码来源:qgsnewvectorlayerdialog.cpp
示例9: QWidget
FocusX::FocusX(QWidget *parent)
: QWidget(parent)
{
lb_now = new QLabel("FocusX:");
lb_start = new QLabel("start at:");
lb_focus_time = new QLabel("working time ");
current_id = -1;
le_now = new QLineEdit("nothing to do");
le_add_task = new QLineEdit();
le_start_time = new QLineEdit();
le_working_time = new QLineEdit();
le_now->setReadOnly(true);
pb_done = new QPushButton("done");
pb_pause = new QPushButton("pause");
pb_add_task = new QPushButton("add");
dte_start = new QDateTimeEdit(QDateTime::currentDateTime());
te_working_time = new QTimeEdit();
le_working_time->setMinimumSize(100, 20);
//le_working_time->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed);
le_now->setMinimumSize(100, 20);
//le_now->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed);
//le_now->setSizePolicy (QSizePolicy::Ignored, QSizePolicy::Ignored);
cb_pin = new QCheckBox("pin", this);
cb_simple = new QCheckBox("simplify", this);
connect(cb_pin, SIGNAL(clicked(bool)),
this, SLOT(set_flag_pin()));
connect(cb_simple, SIGNAL(clicked(bool)),
this, SLOT(set_window_simple()));
timer = new QTimer(this);
connect(timer, SIGNAL(timeout()),
this, SLOT(timer_add_one_second()));
tw_todolist = new QTreeWidget;
tw_todolist->setColumnCount(2);
QStringList tw_headers;
tw_headers << "task" << "working time" << "status";
tw_todolist->setHeaderLabels(tw_headers);
QTreeWidgetItem* tw_root = new QTreeWidgetItem(tw_todolist, QStringList(QString("root")));
new QTreeWidgetItem(tw_root, QStringList(QString("test1")));
new QTreeWidgetItem(tw_root, QStringList(QString("test2")));
QStringList temp;
temp << "task" << "deadline";
new QTreeWidgetItem(tw_root, temp);
QList<QTreeWidgetItem*> rootlist;
rootlist << tw_root;
tw_todolist->insertTopLevelItems(0, rootlist);
tw_todolist->setMinimumHeight(200);
//init_db(QString("focusx.db"));
init_db(QString("focusx.db"));
connect(pb_add_task, SIGNAL(clicked(bool)),
this, SLOT(insert_task()));
connect(pb_pause, SIGNAL(clicked(bool)),
this, SLOT(pause_task()));
connect(pb_done, SIGNAL(clicked(bool)),
this, SLOT(finish_task()));
mainlayout = new QGridLayout;
set_ori_layout();
//mainlayout = new QGridLayout;
setLayout(mainlayout);
/*(mainlayout->addWidget(lb_add_task, 4, 0);
mainlayout->addWidget(le_add_task, 4, 1);
*/
setWindowTitle("FocusX");
//resize(300, 300);
update_from_db();
tw_todolist->setContextMenuPolicy(Qt::CustomContextMenu);
connect(tw_todolist, &QTreeWidget::customContextMenuRequested,
this, &FocusX::right_click_menu);
//|Qt::WindowTitleHint|Qt::Window);//| Qt::FramelessWindowHint);
QSettings settings("kinderlas", "focusx");
restoreGeometry(settings.value( "geometry", saveGeometry() ).toByteArray());
wflag = this->windowFlags();
oflag = this->windowFlags();
cb_pin->setChecked(true);
//cb_simple->setChecked(true);
wflag |= Qt::ToolTip;
wflag |= Qt::WindowStaysOnTopHint;
this->setWindowFlags(wflag);
//this->setWindowFlags(wflag | Qt::CustomizeWindowHint | Qt::WindowStaysOnTopHint);
//| Qt::ToolTip);// | Qt::WindowTitleHint );
this->adjustSize();
qDebug() << this->width() << ", " << this->height();
}
开发者ID:Kinderlas,项目名称:FocusX,代码行数:91,代码来源:focusx.cpp
示例10: QDialog
//.........这里部分代码省略.........
QgsExpressionContext expContext( QgsExpressionContextUtils::globalProjectLayerScopes( mVectorLayer ) );
expContext.lastScope()->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "row_number" ), 1, true ) );
expContext.setHighlightedVariables( QStringList() << QStringLiteral( "row_number" ) );
builder->setLayer( vl );
builder->loadFieldNames();
builder->setExpressionContext( expContext );
populateFields();
populateOutputFieldTypes();
connect( builder, SIGNAL( expressionParsed( bool ) ), this, SLOT( setOkButtonState() ) );
connect( mOutputFieldWidthSpinBox, SIGNAL( editingFinished() ), this, SLOT( setPrecisionMinMax() ) );
QgsDistanceArea myDa;
myDa.setSourceCrs( vl->crs().srsid() );
myDa.setEllipsoidalMode( true );
myDa.setEllipsoid( QgsProject::instance()->ellipsoid() );
builder->setGeomCalculator( myDa );
//default values for field width and precision
mOutputFieldWidthSpinBox->setValue( 10 );
mOutputFieldPrecisionSpinBox->setValue( 3 );
setPrecisionMinMax();
if ( vl->providerType() == QLatin1String( "ogr" ) && vl->storageType() == QLatin1String( "ESRI Shapefile" ) )
{
mOutputFieldNameLineEdit->setMaxLength( 10 );
}
if ( !( vl->dataProvider()->capabilities() & QgsVectorDataProvider::AddAttributes ) )
{
mCreateVirtualFieldCheckbox->setChecked( true );
mCreateVirtualFieldCheckbox->setEnabled( false );
mOnlyVirtualFieldsInfoLabel->setVisible( true );
mInfoIcon->setVisible( true );
}
else
{
mOnlyVirtualFieldsInfoLabel->setVisible( false );
mInfoIcon->setVisible( false );
}
if ( !( vl->dataProvider()->capabilities() & QgsVectorDataProvider::ChangeAttributeValues ) )
{
mUpdateExistingGroupBox->setEnabled( false );
mCreateVirtualFieldCheckbox->setChecked( true );
mCreateVirtualFieldCheckbox->setEnabled( false );
}
Q_ASSERT( mNewFieldGroupBox->isEnabled() || mUpdateExistingGroupBox->isEnabled() );
if ( mNewFieldGroupBox->isEnabled() )
{
mNewFieldGroupBox->setChecked( true );
}
else
{
mNewFieldGroupBox->setToolTip( tr( "Not available for layer" ) );
mUpdateExistingGroupBox->setChecked( true );
mUpdateExistingGroupBox->setCheckable( false );
}
if ( mUpdateExistingGroupBox->isEnabled() )
{
mUpdateExistingGroupBox->setChecked( !mNewFieldGroupBox->isEnabled() );
}
else
{
mUpdateExistingGroupBox->setToolTip( tr( "Not available for layer" ) );
mNewFieldGroupBox->setChecked( true );
mNewFieldGroupBox->setCheckable( false );
}
if (( mNewFieldGroupBox->isChecked() && mCreateVirtualFieldCheckbox->isChecked() ) || mVectorLayer->isEditable() )
{
mEditModeAutoTurnOnLabel->setVisible( false );
mInfoIcon->setVisible( false );
}
else
{
mInfoIcon->setVisible( true );
}
bool hasselection = vl->selectedFeatureCount() > 0;
mOnlyUpdateSelectedCheckBox->setChecked( hasselection );
mOnlyUpdateSelectedCheckBox->setEnabled( hasselection );
mOnlyUpdateSelectedCheckBox->setText( tr( "Only update %1 selected features" ).arg( vl->selectedFeatureCount() ) );
builder->loadRecent( QStringLiteral( "fieldcalc" ) );
mInfoIcon->setPixmap( style()->standardPixmap( QStyle::SP_MessageBoxInformation ) );
setOkButtonState();
QSettings settings;
restoreGeometry( settings.value( QStringLiteral( "/Windows/QgsFieldCalculator/geometry" ) ).toByteArray() );
}
开发者ID:Gustry,项目名称:QGIS,代码行数:101,代码来源:qgsfieldcalculator.cpp
示例11: QMainWindow
XSettingsWindow::XSettingsWindow(const qutim_sdk_0_3::SettingsItemList& settings, QObject* controller, QWidget *parent) :
QMainWindow(parent),
p(new XSettingsWindowPrivate)
{
setAttribute(Qt::WA_DeleteOnClose);
p->controller = controller;
setWindowModality(controller ? Qt::WindowModal : Qt::NonModal);
//setup ui
QWidget *w = new QWidget(this);
QVBoxLayout *l = new QVBoxLayout(w);
Config cfg;
cfg.beginGroup("xsettings/window");
QByteArray data;
p->parent = qobject_cast<XSettingsWindow*>(qApp->activeWindow());
if(p->parent) {
QRect geom = p->parent->geometry();
int width = geom.width()/15;
int height = geom.height()/15;
geom.adjust(width,height,-width,-height);
setGeometry(geom);
} else {
data = cfg.value("geometry", QByteArray());
if (data.isEmpty() || !restoreGeometry(data)) {
QSize desktopSize = QApplication::desktop()->availableGeometry(QCursor::pos()).size();
resize(desktopSize.width() / 2, desktopSize.height() * 2 / 3);
centerizeWidget(this);
}
}
//init widgets
p->splitter = new QSplitter(Qt::Horizontal,w);
p->listWidget = new QListWidget(w);
p->stackedWidget = new QStackedWidget(w);
//default widget
QWidget *empty = new QWidget(this);
p->stackedWidget->addWidget(empty);
p->splitter->addWidget(p->listWidget);
p->splitter->addWidget(p->stackedWidget);
data = cfg.value("splitterState", QByteArray());
if (data.isEmpty() || !p->splitter->restoreState(data))
p->splitter->setSizes(QList<int>() << 80 << 250);
l->addWidget(p->splitter);
QDialogButtonBox::StandardButtons buttons;
if (controller)
buttons = QDialogButtonBox::Ok;
else
buttons = QDialogButtonBox::Save | QDialogButtonBox::Cancel;
p->buttonBox = new QDialogButtonBox(buttons, Qt::Horizontal, w);
l->addWidget(p->buttonBox);
p->buttonBox->setVisible(controller);
//init actiontoolbar
setCentralWidget(w);
setUnifiedTitleAndToolBarOnMac(true);
p->toolBar = new ActionToolBar(w);
addToolBar(Qt::TopToolBarArea,p->toolBar);
int width = style()->pixelMetric(QStyle::PM_IconViewIconSize);
QSize size = QSize(width, width);
p->toolBar->setIconSize(size);
p->toolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
p->toolBar->setObjectName(QLatin1String("SettingsBar"));
p->toolBar->setMovable(false);
#if defined (Q_WS_WIN32) || defined(Q_WS_MAC)
width = 22;
#else
width = style()->pixelMetric(QStyle::PM_ToolBarIconSize);
#endif
size = QSize(width, width);
p->listWidget->setIconSize(size);
p->group = new QActionGroup(w);
p->group->setExclusive(true);
//connections
connect(p->group,SIGNAL(triggered(QAction*)), SLOT(onGroupActionTriggered(QAction*)));
connect(p->listWidget,
SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)),
SLOT(onCurrentItemChanged(QListWidgetItem*))
);
connect(p->buttonBox,SIGNAL(accepted()), SLOT(save()));
connect(p->buttonBox,SIGNAL(rejected()), SLOT(cancel()));
loadSettings(settings);
if (p->group->actions().count())
p->group->actions().first()->trigger();
}
开发者ID:dganic,项目名称:qutim,代码行数:91,代码来源:xsettingswindow.cpp
示例12: QDialog
QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWidget *parent, Qt::WindowFlags flags )
: QDialog( parent, flags )
, mDock( 0 )
, mLayer( theLayer )
{
setupUi( this );
// Fix selection color on loosing focus (Windows)
setStyleSheet( QgisApp::instance()->styleSheet() );
setAttribute( Qt::WA_DeleteOnClose );
QSettings settings;
// Initialize the window geometry
restoreGeometry( settings.value( "/Windows/BetterAttributeTable/geometry" ).toByteArray() );
QgsAttributeEditorContext context;
myDa = new QgsDistanceArea();
myDa->setSourceCrs( mLayer->crs() );
myDa->setEllipsoidalMode( QgisApp::instance()->mapCanvas()->mapSettings().hasCrsTransformEnabled() );
myDa->setEllipsoid( QgsProject::instance()->readEntry( "Measure", "/Ellipsoid", GEO_NONE ) );
context.setDistanceArea( *myDa );
context.setVectorLayerTools( QgisApp::instance()->vectorLayerTools() );
// Initialize dual view
mMainView->init( mLayer, QgisApp::instance()->mapCanvas(), QgsFeatureRequest(), context );
// Initialize filter gui elements
mFilterActionMapper = new QSignalMapper( this );
mFilterColumnsMenu = new QMenu( this );
mActionFilterColumnsMenu->setMenu( mFilterColumnsMenu );
mApplyFilterButton->setDefaultAction( mActionApplyFilter );
// Set filter icon in a couple of places
QIcon filterIcon = QgsApplication::getThemeIcon( "/mActionFilter.svg" );
mActionShowAllFilter->setIcon( filterIcon );
mActionAdvancedFilter->setIcon( filterIcon );
mActionSelectedFilter->setIcon( filterIcon );
mActionVisibleFilter->setIcon( filterIcon );
mActionEditedFilter->setIcon( filterIcon );
// Connect filter signals
connect( mActionAdvancedFilter, SIGNAL( triggered() ), SLOT( filterExpressionBuilder() ) );
connect( mActionShowAllFilter, SIGNAL( triggered() ), SLOT( filterShowAll() ) );
connect( mActionSelectedFilter, SIGNAL( triggered() ), SLOT( filterSelected() ) );
connect( mActionVisibleFilter, SIGNAL( triggered() ), SLOT( filterVisible() ) );
connect( mActionEditedFilter, SIGNAL( triggered() ), SLOT( filterEdited() ) );
connect( mFilterActionMapper, SIGNAL( mapped( QObject* ) ), SLOT( filterColumnChanged( QObject* ) ) );
connect( mFilterQuery, SIGNAL( returnPressed() ), SLOT( filterQueryAccepted() ) );
connect( mActionApplyFilter, SIGNAL( triggered() ), SLOT( filterQueryAccepted() ) );
// info from layer to table
connect( mLayer, SIGNAL( editingStarted() ), this, SLOT( editingToggled() ) );
connect( mLayer, SIGNAL( editingStopped() ), this, SLOT( editingToggled() ) );
connect( mLayer, SIGNAL( layerDeleted() ), this, SLOT( close() ) );
connect( mLayer, SIGNAL( selectionChanged() ), this, SLOT( updateTitle() ) );
connect( mLayer, SIGNAL( attributeAdded( int ) ), this, SLOT( columnBoxInit() ) );
connect( mLayer, SIGNAL( attributeDeleted( int ) ), this, SLOT( columnBoxInit() ) );
// connect table info to window
connect( mMainView, SIGNAL( filterChanged() ), this, SLOT( updateTitle() ) );
// info from table to application
connect( this, SIGNAL( saveEdits( QgsMapLayer * ) ), QgisApp::instance(), SLOT( saveEdits( QgsMapLayer * ) ) );
bool myDockFlag = settings.value( "/qgis/dockAttributeTable", false ).toBool();
if ( myDockFlag )
{
mDock = new QgsAttributeTableDock( tr( "Attribute table - %1 (%n Feature(s))", "feature count", mMainView->featureCount() ).arg( mLayer->name() ), QgisApp::instance() );
mDock->setAllowedAreas( Qt::BottomDockWidgetArea | Qt::TopDockWidgetArea );
mDock->setWidget( this );
connect( this, SIGNAL( destroyed() ), mDock, SLOT( close() ) );
QgisApp::instance()->addDockWidget( Qt::BottomDockWidgetArea, mDock );
}
columnBoxInit();
updateTitle();
mRemoveSelectionButton->setIcon( QgsApplication::getThemeIcon( "/mActionUnselectAttributes.png" ) );
mSelectedToTopButton->setIcon( QgsApplication::getThemeIcon( "/mActionSelectedToTop.png" ) );
mCopySelectedRowsButton->setIcon( QgsApplication::getThemeIcon( "/mActionCopySelected.png" ) );
mZoomMapToSelectedRowsButton->setIcon( QgsApplication::getThemeIcon( "/mActionZoomToSelected.svg" ) );
mPanMapToSelectedRowsButton->setIcon( QgsApplication::getThemeIcon( "/mActionPanToSelected.svg" ) );
mInvertSelectionButton->setIcon( QgsApplication::getThemeIcon( "/mActionInvertSelection.png" ) );
mToggleEditingButton->setIcon( QgsApplication::getThemeIcon( "/mActionToggleEditing.svg" ) );
mSaveEditsButton->setIcon( QgsApplication::getThemeIcon( "/mActionSaveEdits.svg" ) );
mDeleteSelectedButton->setIcon( QgsApplication::getThemeIcon( "/mActionDeleteSelected.svg" ) );
mOpenFieldCalculator->setIcon( QgsApplication::getThemeIcon( "/mActionCalculateField.png" ) );
mAddAttribute->setIcon( QgsApplication::getThemeIcon( "/mActionNewAttribute.png" ) );
mRemoveAttribute->setIcon( QgsApplication::getThemeIcon( "/mActionDeleteAttribute.png" ) );
mTableViewButton->setIcon( QgsApplication::getThemeIcon( "/mActionOpenTable.png" ) );
mAttributeViewButton->setIcon( QgsApplication::getThemeIcon( "/mActionPropertyItem.png" ) );
mExpressionSelectButton->setIcon( QgsApplication::getThemeIcon( "/mIconExpressionSelect.svg" ) );
mAddFeature->setIcon( QgsApplication::getThemeIcon( "/mActionNewTableRow.png" ) );
// toggle editing
//.........这里部分代码省略.........
开发者ID:Ariki,项目名称:QGIS,代码行数:101,代码来源:qgsattributetabledialog.cpp
示例13: restoreGeometry
void QgsGPSPluginGui::restoreState()
{
QSettings settings;
restoreGeometry( settings.value( "/Plugin-GPS/geometry" ).toByteArray() );
tabWidget->setCurrentIndex( settings.value( "/Plugin-GPS/lastTab", 4 ).toInt() );
}
开发者ID:Adam-Brown,项目名称:Quantum-GIS,代码行数:6,代码来源:qgsgpsplugingui.cpp
示例14: QMainWindow
//.........这里部分代码省略.........
// Only start RTK fetcher, RoverConnection, PtuController etc. if we're working online
if(mOperatingMode == OperatingMode::OperatingOnline)
{
mRoverConnection = new RoverConnection(mConnectionDialog->getRoverHostName(), mConnectionDialog->getRoverPort(), this);
connect(mControlWidget, &ControlWidget::setScannerState, mRoverConnection, &RoverConnection::slotSendScannerState);
mPidControllerWidget->setControllers(mRoverConnection->getFlightControllerValues()); // set this once. Table is rebuilt when signal from roverconnection comes in
mJoystick = new Joystick;
if(!mJoystick->isValid())
{
QMessageBox::warning(this, "Joystick not found", "Joystick initialization failed, using manual control will be impossible.");
}
else
{
connect(mJoystick, &Joystick::motion, mRoverConnection, &RoverConnection::slotSendMotionToKopter);
connect(mJoystick, &Joystick::buttonStateChanged, this, &BaseStation::slotManageJoystick);
mTimerJoystick = new QTimer(this);
connect(mTimerJoystick, &QTimer::timeout, mJoystick, &Joystick::slotEmitMotionCommands);
}
connect(mPidControllerWidget, &PidControllerWidget::controllerWeight, mRoverConnection, &RoverConnection::slotSendControllerWeights);
connect(mRoverConnection, &RoverConnection::flightState, mControlWidget, &ControlWidget::slotSetFlightState);
connect(mRoverConnection, &RoverConnection::flightStateRestriction, mControlWidget, &ControlWidget::slotSetFlightStateRestriction);
connect(mRoverConnection, &RoverConnection::message, mLogWidget, &LogWidget::log);
connect(mRoverConnection, &RoverConnection::vehiclePose, mControlWidget, &ControlWidget::slotUpdatePose);
connect(mRoverConnection, &RoverConnection::vehiclePose, mFlightPlanner, &FlightPlannerParticles::slotVehiclePoseChanged);
// connect(mRoverConnection, &RoverConnection::vehiclePose, mPtuController, &PtuController::slotVehiclePoseChanged);
connect(mRoverConnection, &RoverConnection::vehiclePose, mGlScene, &GlScene::slotNewVehiclePose);
connect(mRoverConnection, &RoverConnection::connectionStatusRover, mControlWidget, &ControlWidget::slotUpdateConnectionRover);
connect(mRoverConnection, &RoverConnection::scanData, mFlightPlanner, &FlightPlannerParticles::slotNewScanFused);
connect(mRoverConnection, &RoverConnection::vehicleStatus, mControlWidget, &ControlWidget::slotUpdateVehicleStatus);
connect(mRoverConnection, &RoverConnection::gnssStatus, mControlWidget, &ControlWidget::slotUpdateInsStatus);
connect(mRoverConnection, &RoverConnection::gnssStatus, mGlScene, &GlScene::slotSetInsStatus);
connect(mRoverConnection, &RoverConnection::flightControllerValues, this, &BaseStation::slotSetFlightControllerValues);
connect(mRoverConnection, &RoverConnection::wayPointReachedByRover, mFlightPlanner, &FlightPlannerParticles::slotWayPointReached);
connect(mRoverConnection, &RoverConnection::wayPoints, mFlightPlanner, &FlightPlannerParticles::slotSetWayPoints);
connect(mFlightPlanner, &FlightPlannerParticles::wayPoints, mRoverConnection, &RoverConnection::slotSetWayPoints);
mDiffCorrFetcher = new DiffCorrFetcher(mConnectionDialog->getRtkBaseHostName(), mConnectionDialog->getRtkBasePort(), this);
connect(mDiffCorrFetcher, &DiffCorrFetcher::differentialCorrections, mRoverConnection, &RoverConnection::slotSendDiffCorrToRover);
connect(mDiffCorrFetcher, &DiffCorrFetcher::connectionStatus, mControlWidget, &ControlWidget::slotUpdateConnectionDiffCorr);
menuBar()->addAction("Connect", mRoverConnection, SLOT(slotConnectToRover()));
mAudioPlayer = new AudioPlayer;
connect(mRoverConnection, &RoverConnection::gnssStatus, this, &BaseStation::slotSpeakGnssStatus);
mActionEnableAudio->setChecked(true); // enable audio out by default when in the field
mRoverConnection->slotConnectToRover();
mLogWidget->log(Information, "BaseSta
|
请发表评论