本文整理汇总了C++中setupLayout函数的典型用法代码示例。如果您正苦于以下问题:C++ setupLayout函数的具体用法?C++ setupLayout怎么用?C++ setupLayout使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setupLayout函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QMainWindow
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent)
{
fileDialog = new QFileDialog(this);
setupLayout();
setupMenuBar();
}
示例2: qstring
int Font::offsetForPositionForComplexText(const TextRun& run, int position, bool includePartialGlyphs) const
{
QString string = qstring(run);
QTextLayout layout(string, font());
QTextLine line = setupLayout(&layout, run);
return line.xToCursor(position);
}
示例3: SettingsPage
ProfilePage::ProfilePage(QWidget *parent)
: SettingsPage(SCHAT_ICON(Profile), LS("profile"), parent)
{
m_profileLabel = new QLabel(this);
m_nickLabel = new QLabel(this);
m_nickEdit = new NickEdit(this);
m_genderLabel = new QLabel(this);
m_genderField = new GenderField(this);
m_layout = new ProfileLayout(this);
QGridLayout *profileLay = new QGridLayout();
profileLay->addWidget(m_nickLabel, 0, 0);
profileLay->addWidget(m_nickEdit, 0, 1, 1, 2);
profileLay->addWidget(m_genderLabel, 1, 0);
profileLay->addWidget(m_genderField, 1, 1);
profileLay->addWidget(m_layout->button(), 1, 2);
profileLay->setContentsMargins(10, 0, 3, 0);
m_mainLayout = new QVBoxLayout();
m_mainLayout->addWidget(m_profileLabel);
m_mainLayout->addLayout(profileLay);
m_mainLayout->addWidget(m_layout);
setupLayout();
retranslateUi();
}
示例4: QGroupBox
//-----------------------------------------------------------------------------
// Function: BusDefGroup::BusDefGroup()
//-----------------------------------------------------------------------------
BusDefGroup::BusDefGroup(QWidget *parent):
QGroupBox(tr("General (Bus Definition)"), parent),
busDef_(),
directConnection_(tr("Allow direct master-slave connection"), this),
isAddressable_(tr("Addressable bus"), this),
maxMasters_(this),
maxSlaves_(this),
descriptionEditor_(this)
{
QRegExp regExp(QString("[0-9]*"), Qt::CaseInsensitive, QRegExp::W3CXmlSchema11);
QRegExpValidator* validator = new QRegExpValidator(regExp, this);
maxMasters_.setValidator(validator);
maxSlaves_.setValidator(validator);
maxMasters_.setPlaceholderText(tr("unbound"));
maxSlaves_.setPlaceholderText(tr("unbound"));
setupLayout();
connect(&maxMasters_, SIGNAL(editingFinished()), this, SLOT(onMastersChanged()), Qt::UniqueConnection);
connect(&maxSlaves_, SIGNAL(editingFinished()), this, SLOT(onSlavesChanged()), Qt::UniqueConnection);
connect(&directConnection_, SIGNAL(toggled(bool)),
this, SLOT(onDirectConnectionChanged(bool)), Qt::UniqueConnection);
connect(&isAddressable_, SIGNAL(toggled(bool)),
this, SLOT(onIsAddressableChanged(bool)), Qt::UniqueConnection);
connect(&descriptionEditor_, SIGNAL(textChanged()), this, SLOT(onDescriptionChanged()), Qt::UniqueConnection);
}
示例5: wxDialog
SetupWizardDialog::SetupWizardDialog(wxWindow* parent) : wxDialog(parent, -1, "First Time SLADE Setup", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
{
// Create pages
pages.push_back(new TempFolderWizardPage(this));
pages.push_back(new BaseResourceWizardPage(this));
pages.push_back(new NodeBuildersWizardPage(this));
current_page = 0;
// Hide all pages
for (unsigned a = 0; a < pages.size(); a++)
pages[a]->Show(false);
// Init layout
setupLayout();
// Set icon
wxIcon icon;
icon.CopyFromBitmap(getIcon("i_logo"));
SetIcon(icon);
// Setup layout
SetInitialSize(wxSize(600, 500));
Layout();
Fit();
SetMinSize(GetBestSize());
CenterOnParent();
showPage(0);
// Bind events
btn_next->Bind(wxEVT_BUTTON, &SetupWizardDialog::onBtnNext, this);
btn_prev->Bind(wxEVT_BUTTON, &SetupWizardDialog::onBtnPrev, this);
}
示例6: config
void EmergingPlasmoid::init() {
gentooLogoLabel.setAlignment(Qt::AlignCenter | Qt::AlignHCenter);
gentooLogoLabel.setOpacity(0.7f);
currentJobMeter.setMeterType(Plasma::Meter::BarMeterHorizontal);
currentJobMeter.setMaximum(100);
currentJobMeter.setMaximumHeight(40.0f);
currentJobMeter.setMinimumHeight(40.0f);
currentJobMeter.setLabelAlignment(0, Qt::AlignJustify | Qt::AlignVCenter);
currentJobMeter.setLabelAlignment(1, Qt::AlignRight | Qt::AlignVCenter);
currentJobMeter.setLabelAlignment(2, Qt::AlignRight | Qt::AlignVCenter);
totalJobMeter.setMeterType(Plasma::Meter::BarMeterHorizontal);
totalJobMeter.setMaximum(100);
totalJobMeter.setMaximumHeight(40.0f);
totalJobMeter.setMinimumHeight(40.0f);
totalJobMeter.setLabelAlignment(0, Qt::AlignJustify | Qt::AlignVCenter);
totalJobMeter.setLabelAlignment(1, Qt::AlignRight | Qt::AlignVCenter);
totalJobMeter.setLabelAlignment(2, Qt::AlignRight | Qt::AlignVCenter);
KConfigGroup conf = config();
timeout = conf.readEntry("timeout", 10);
logoPosition =(LogoPosition) conf.readEntry("logoPosition", (int)LogoInTop);
layout = new QGraphicsGridLayout(this);
setupLayout();
clear();
}
示例7: fixSpacing
int Font::offsetForPositionForComplexText(const TextRun& run, int position, bool) const
{
const QString string = fixSpacing(qstring(run));
QTextLayout layout(string, font());
QTextLine line = setupLayout(&layout, run);
return line.xToCursor(position);
}
示例8: QWidget
SettingsWidget::SettingsWidget(QWidget *parent):
QWidget( parent )
{
setupComponents();
setupActions();
setupLayout();
}
示例9: PrefsPanelBase
// -----------------------------------------------------------------------------
// GraphicsPrefsPanel class constructor
// -----------------------------------------------------------------------------
GraphicsPrefsPanel::GraphicsPrefsPanel(wxWindow* parent) : PrefsPanelBase(parent)
{
// Create controls
auto cp_flags = wxCLRP_SHOW_LABEL | wxCLRP_USE_TEXTCTRL;
cp_colour1_ = new wxColourPickerCtrl(this, -1, *wxBLACK, wxDefaultPosition, wxDefaultSize, cp_flags);
cp_colour2_ = new wxColourPickerCtrl(this, -1, *wxBLACK, wxDefaultPosition, wxDefaultSize, cp_flags);
choice_presets_ = new wxChoice(this, -1);
choice_presets_->Append(WxUtils::arrayString({ "Default",
"Black",
"Black (Checkered)",
"Cyan",
"Cyan (Checkered)",
"Magenta",
"Magenta (Checkered)",
"White",
"White (Checkered)",
"Yellow",
"Yellow (Checkered)",
"Vintage Id Software" }));
choice_browser_bg_ = new wxChoice(this, -1);
choice_browser_bg_->Append(
WxUtils::arrayString({ "Transparent background (as above)", "System background", "Black background" }));
cb_show_border_ = new wxCheckBox(this, -1, "Show outline around graphics and textures");
cb_hilight_mouseover_ = new wxCheckBox(this, -1, "Hilight graphics on mouse hover");
cb_extra_gfxconv_ = new wxCheckBox(this, -1, "Offer additional conversion options");
setupLayout();
// Bind events
choice_presets_->Bind(wxEVT_CHOICE, &GraphicsPrefsPanel::onChoicePresetSelected, this);
}
示例10: QGroupBox
//-----------------------------------------------------------------------------
// Function: AbsDefGroup::AbsDefGroup()
//-----------------------------------------------------------------------------
AbsDefGroup::AbsDefGroup(LibraryInterface* handler, QWidget *parent):
QGroupBox(tr("Signals (Abstraction Definition)"), parent),
portView_(this),
portModel_(this),
handler_(handler),
absDef_()
{
portView_.setModel(&portModel_);
portView_.setItemDelegate(new BusPortsDelegate(this));
portView_.setAllowImportExport(true);
portView_.setItemsDraggable(false);
connect(&portView_, SIGNAL(addSignalOptions()), this, SLOT(onAddSignalOptions()), Qt::UniqueConnection);
connect(&portModel_, SIGNAL(dataChanged(const QModelIndex&, const QModelIndex&)),
this, SIGNAL(contentChanged()), Qt::UniqueConnection);
connect(&portModel_, SIGNAL(contentChanged()),
this, SIGNAL(contentChanged()), Qt::UniqueConnection);
connect(&portModel_, SIGNAL(noticeMessage(const QString&)),
this, SIGNAL(noticeMessage(const QString&)), Qt::UniqueConnection);
connect(&portModel_, SIGNAL(errorMessage(const QString&)),
this, SIGNAL(errorMessage(const QString&)), Qt::UniqueConnection);
connect(&portModel_, SIGNAL(portRenamed(const QString&, const QString&)),
this, SIGNAL(portRenamed(const QString&, const QString&)), Qt::UniqueConnection);
connect(&portModel_, SIGNAL(portRemoved(const QString&, const General::InterfaceMode)),
this, SIGNAL(portRemoved(const QString&, const General::InterfaceMode)), Qt::UniqueConnection);
connect(&portView_, SIGNAL(addItem(const QModelIndex&)),
&portModel_, SLOT(addSignal()), Qt::UniqueConnection);
connect(&portView_, SIGNAL(removeItem(const QModelIndex&)),
&portModel_, SLOT(onRemoveItem(const QModelIndex&)), Qt::UniqueConnection);
setupLayout();
}
示例11: QWidget
/**
* Constructor.
* @param cam
* @param parent
*/
CameraCalibrationEvaluation::CameraCalibrationEvaluation(scc::CameraCalibration *cam,
QWidget *parent) :
QWidget(parent) {
qDebug() << "CameraCalibrationEvaluation(QTabWidget *parent):";
cameraCalibration = cam;
setupLayout();
}
示例12: STopWindow
/* MainWindow::MainWindow
* MainWindow class constructor
*******************************************************************/
MainWindow::MainWindow()
: STopWindow("SLADE", mw_left, mw_top, mw_width, mw_height) {
lasttipindex = 0;
custom_menus_begin = 2;
if (mw_maximized) Maximize();
setupLayout();
SetDropTarget(new MainWindowDropTarget());
}
示例13: ItemEditor
//-----------------------------------------------------------------------------
// Function: AddressSpaceEditor::AddressSpaceEditor()
//-----------------------------------------------------------------------------
AddressSpaceEditor::AddressSpaceEditor(QSharedPointer<Component> component,
LibraryInterface* handler,
QSharedPointer<AddressSpace> addrSpace,
QSharedPointer <ParameterFinder> parameterFinder,
QSharedPointer <ExpressionFormatter> expressionFormatter,
QSharedPointer<ExpressionParser> expressionParser,
QWidget* parent):
ItemEditor(component, handler, parent),
addrSpace_(addrSpace),
nameEditor_(addrSpace->getNameGroup(), this),
generalEditor_(addrSpace, component->getMasterInterfaces(addrSpace_->getName()), parameterFinder,
expressionParser, this),
segmentsEditor_(addrSpace, component, handler->getDirectoryPath(*component->getVlnv()), parameterFinder,
expressionParser, expressionFormatter, this),
localMemMapEditor_(addrSpace->getLocalMemoryMap(), component, handler, parameterFinder, expressionFormatter,
this)
{
Q_ASSERT(addrSpace_);
nameEditor_.setTitle(tr("Address space name and description"));
connect(&nameEditor_, SIGNAL(contentChanged()), this, SIGNAL(contentChanged()), Qt::UniqueConnection);
connect(&generalEditor_, SIGNAL(contentChanged()), this, SIGNAL(contentChanged()), Qt::UniqueConnection);
connect(&generalEditor_, SIGNAL(graphicsChanged()), this, SIGNAL(graphicsChanged()), Qt::UniqueConnection);
connect(&generalEditor_, SIGNAL(increaseReferences(QString)),
this, SIGNAL(increaseReferences(QString)), Qt::UniqueConnection);
connect(&generalEditor_, SIGNAL(decreaseReferences(QString)),
this, SIGNAL(decreaseReferences(QString)), Qt::UniqueConnection);
connect(&segmentsEditor_, SIGNAL(contentChanged()), this, SIGNAL(contentChanged()), Qt::UniqueConnection);
connect(&segmentsEditor_, SIGNAL(contentChanged()), this, SIGNAL(graphicsChanged()), Qt::UniqueConnection);
connect(&segmentsEditor_, SIGNAL(errorMessage(const QString&)),
this, SIGNAL(errorMessage(const QString&)), Qt::UniqueConnection);
connect(&segmentsEditor_, SIGNAL(noticeMessage(const QString&)),
this, SIGNAL(noticeMessage(const QString&)), Qt::UniqueConnection);
connect(&localMemMapEditor_, SIGNAL(contentChanged()), this, SIGNAL(contentChanged()), Qt::UniqueConnection);
connect(&localMemMapEditor_, SIGNAL(graphicsChanged()), this, SIGNAL(graphicsChanged()), Qt::UniqueConnection);
connect(&localMemMapEditor_, SIGNAL(errorMessage(const QString&)),
this, SIGNAL(errorMessage(const QString&)), Qt::UniqueConnection);
connect(&localMemMapEditor_, SIGNAL(itemAdded(int)),
this, SIGNAL(childAdded(int)), Qt::UniqueConnection);
connect(&localMemMapEditor_, SIGNAL(itemRemoved(int)),
this, SIGNAL(childRemoved(int)), Qt::UniqueConnection);
connect(&localMemMapEditor_, SIGNAL(increaseReferences(QString)),
this, SIGNAL(increaseReferences(QString)), Qt::UniqueConnection);
connect(&localMemMapEditor_, SIGNAL(decreaseReferences(QString)),
this, SIGNAL(decreaseReferences(QString)), Qt::UniqueConnection);
setupLayout();
refresh();
}
示例14: SettingsPage
//-----------------------------------------------------------------------------
// Function: ComponentEditorSettingsPage::ComponentEditorSettingsPage()
//-----------------------------------------------------------------------------
ComponentEditorSettingsPage::ComponentEditorSettingsPage(QSettings &settings) :
SettingsPage(settings),
workspaceHwCheckBoxes_(),
workspaceSwCheckBoxes_(),
currentWorkspaceIndex_(0)
{
loadSettings();
setupLayout();
}
示例15: PreferencesWidget
DebugPreferences::DebugPreferences(QWidget * parent) :
PreferencesWidget(parent),
layout_(NULL)
{
setTitle(tr("Debug"));
setIcon(iconFromTheme("tools-report-bug"));
setupLayout();
setupUI();
}